<?php
/**
 * @author: TuanPM 
 * @since: 27/12/2012
 * @todo : 
 */
class Listxml_modTree extends Efy_DB_Connection {
	public function mTL_TreeGetAll($arrParameter){		
		$arrResult = array();
		$sql = "";
		foreach ($arrParameter as $key => $value) {
			if($sql !=''){
				$sql .= ",'" . $value . "'";
			}else{
				$sql .= "'" . $value . "'";
			}
		}
		$sql = "Exec mTL_TreeGetAll ".$sql;
		// echo $sql;die();
		try{
			$arrResul = $this->adodbQueryDataInNameMode($sql);
		}catch (Exception $e){
			echo $e->getMessage();
		}		
		return $arrResul;
	}

	public function mTL_TreeGetSingle($sPkTree){
		$arrResult = null;
		$sql = "Exec mTL_TreeGetSingle ";
		$sql .= "'" . $sPkTree . "'";
		//echo $sql; 
		try{
			$arrResult = $this->adodbExecSqlString($sql);
		}catch (Exception $e){
			echo $e->getMessage();//
		};
		return $arrResult;
	}

	public function mTL_TreeUpdate($arrParameter)
	{
		$arrResult = array();
		$sql = "";
		foreach ($arrParameter as $key => $value) {
			if($sql !=''){
				$sql .= ",'" . $value . "'";
			}else{
				$sql .= "'" . $value . "'";
			}
		}
		$sql = "Exec mTL_TreeUpdate ".$sql;
		//echo $sql; exit();
		try{		
			$arrResult = $this->adodbExecSqlString($sql);			
		}catch (Exception $e){
			echo $e->getMessage();
		};		
		return $arrResult;
	}

	public function mTL_TreeDelete($sPkTree,$delimitorElement){
		$arrResult = null;			
		$sql = "Exec mTL_TreeDelete ";		
		$sql .= "'".$sPkTree ."'";
		$sql .= ",'".$delimitorElement."'";	
		// $sql .= ",'".$delimitorElement ."'";	
		// echo $sql; exit;
		try {			
			$arrResult = $this->adodbExecSqlString($sql) ; 			
		}catch (Exception $e){
			echo $e->getMessage();
		};				
		return $arrResult;	
	}	
}
?>
